<?php

/**
 * Description of language
 *
 * @author libaoling
 * @time 2015-2-13
 */
class LanguageModel extends BaseModel
{
    public $table      =   'language';
    public $prikey     =   'lang_id';
    public $_name      =   'language';
    
    public function get_default_lang()
    {
        $sql = "select lang_id from wl_language where default_lang=1";
        $info = $this->getCol($sql);
        return $info ? $info[0] : 1;
    }
    
    public function get_list()
    {
        return $this->find();
    }
    
    public function get_id_by_lang($lang)
    {
        $sql = "select lang_id from wl_language where lang='{$lang}'";
        $info = $this->getCol($sql);
        return $info ? $info[0] : 1;
    }
}